#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <vector>
#include <iterator>
#include <functional>
#include <boost/bind.hpp>
#include <boost/timer.hpp>
#include <boost/shared_ptr.hpp>

using namespace std;

struct A
{
	int a;
	A():a(123){}

        static void* operator new (size_t size)
	{
		void* p = ::operator new(size);
		cout<<"NEW"<<endl;
		return p;
	}

        static void operator delete (void *p)
	{
		::operator delete(p);
		cout<<"DELETE"<<endl;
	}

	friend ostream& operator<<(ostream& os, A a)
	{
		os<<a.a<<endl;
		return os;
	}

	friend istream& operator>> (istream& is, A a)
	{
		is>>a.a;
		return is;
	}
};

int main(int argc, char** argv)
{
	A *pa = new A;
	cout<<*pa<<endl;
	return 0;
}
